package com.LeeCode;

import java.util.HashSet;
import java.util.Set;

/**
 * 统计范围内的元音字符串数
 */

public class Code2586 {
    public static void main(String[] args) {

    }

    public int vowelStrings(String[] words, int left, int right) {
        Set<Character> vowels = new HashSet<>();
        vowels.add('a');
        vowels.add('e');
        vowels.add('i');
        vowels.add('o');
        vowels.add('u');

        int ans = 0;

        for (int i = left; i <= right; i++) {
            String word = words[i];
            if(vowels.contains(word.charAt(0)) && vowels.contains(word.charAt(word.length() - 1))) {
                ans++;
            }
        }
        return ans;
    }
}
